package com.woniu.staff.util;

public class RedisKey {
    //返回注册验证码再redis中的key
    public static String registerCodeKey(String mobile){
        return "register:code:mobile:"+mobile;
    }

//    返回登录验证码再redis中的key
    public static String loginCodeKey(String mobile){
        return "login:code:mobile:"+mobile;
    }
    //返回注册业务在一分钟内是否向某手机发送过验证码的key
    public static String registerMinute(String mobile){
        return "register:code:minute:mobile:"+mobile;
    }

    //返回注册业务在一小时内是否向某手机发送过验证码的key的总次数
    public static String sendCodeNumber(String mobile){
        return "send:message:number:mobile:"+mobile;
    }

    //返回登录业务在一小时内是否向某手机发送过验证码的key的总次数
    public static String sendCodeNumberLogin(String mobile){
        return "send:message:number:mobile:login:"+mobile;
    }

    //返回登录业务
    public static String codeErrorNumber(String mobile){
        return "code:error:number:mobile:"+mobile;
    }
    public static String loginCodeErrorNumber(String mobile){
        return "login:code:error:number:mobile:"+mobile;
    }
    //返回登录业务在一分钟内是否向某手机发送过验证码的key
    public static String registerCode(String mobile){
        return "code:login:number:mobile:"+mobile;
    }

    //返回用户的收藏列表的key
    public static String collectList(Integer userId) {
        return "code:collect:list:"+userId;
    }
    //返回收藏排行榜的key
    public static String collectRank() {
        return "collect:rand:";
    }
    //向购物车中添加购物列表key
    public static String shoppingUser(String userId){
        return "shopping:user:"+userId;
    }

    public static String shoppingUserBook(int userId, Integer bookId) {
        return "shopping:user:"+userId+":book:"+bookId;
    }
    public static String shoppingUserBook(String userId, String bookId) {
        return "shopping:user:"+userId+":book:"+bookId;
    }


    public static String bookIdLock(String bookId){
        return "lock:bookId:"+bookId;
    }
    public  static  String phoneLock(String phone){
        return  "phone:phoneLock:"+phone;
    }

    public  static  String userNameLock(String username){
        return  "username:userNameLock:"+username;
    }

    //返回某用户购物车列表KEY
    public  static  String userShopping(Integer userId){
        return "user:shopping:userid:"+userId;
    }

    //返回某用户购物车某商品的信息KEY
    public  static  String shoppingInfo(Integer userId, Integer pillsId){
        return "user:shoppingInfo:userid:"+userId+":bookid:"+pillsId;

    }

    public  static  String PillsIdLock(String pillsId){
        return "lock:pillsid:"+pillsId;
    }

}
